home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10009_Volume Button Script.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  535 b   |  22 lines

  1. global gSoundLevel
  2.  
  3. on mouseDown
  4.   global glstAppParams
  5.   repeat while the mouseDown
  6.     set X to the mouseH
  7.     if X > SpriteRight(28) then
  8.       set X to SpriteRight(28)
  9.     end if
  10.     if X < SpriteLeft(28) then
  11.       set X to SpriteLeft(28)
  12.     end if
  13.     set the locH of sprite 29 to X
  14.     updateStage()
  15.   end repeat
  16.   set Percent to ((the locH of sprite 29 * 1.0) - (SpriteLeft(28) + (SpriteWidth(29) / 2))) / (SpriteWidth(28) - SpriteWidth(29))
  17.   set gSoundLevel to integer(Percent * 7)
  18.   setSound()
  19.   beep()
  20.   updateStage()
  21. end
  22.